package com.jxpanda.spring.module.wechat.component.message.pojo.general;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.jxpanda.spring.module.wechat.component.message.pojo.MsgType;
import com.jxpanda.spring.module.wechat.component.message.pojo.WechatMessage;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;

@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@Data
public class WechatTextCardMessage extends WechatMessage {
    /**
     * 是否开启id转译，0表示否，1表示是，默认0
     */
    @JsonProperty("enable_id_trans")
    private int enableIdTrans;

    @JsonProperty("textcard")
    private TextCard textCard;

    @Override
    public String getMsgType() {
        return MsgType.TEXT_CARD.getValue();
    }

    @Data
    public static class TextCard {
        /**
         * 标题
         */
        @JsonProperty("title")
        private String title;

        /**
         * 描述
         */
        @JsonProperty("description")
        private String description;

        /**
         * 点击后跳转的链接
         */
        @JsonProperty("url")
        private String url;

        /**
         * 按钮文字
         */
        @JsonProperty("btntxt")
        private String btnTxt;
    }
}
